<template>
  <div style="display: flex;line-height: 60px" >
    <div >
      <i :class="icon" @click="collapse" style="font-size: 20px"></i>
    </div>
    <div style="flex: 1;text-align: center;font-size: 34px">
      <span>{{msg}}</span>
    </div>
    <el-dropdown>
      <span>王小虎</span>
      <i class="el-icon-arrow-down" style="margin-left: 5px"></i>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item @click.native="toUser">个人中心</el-dropdown-item>
        <el-dropdown-item @click.native="logout">退出</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>

  </div>
</template>

<style scoped>

</style>

<script>
export default {
  name: "Head",
  methods: {
    toUser(){
      console.log("个人中心")
    },
    logout(){
      console.log("退出")
    },
    collapse(){
      this.$emit('doCollapse')
    }
  },
  data(){
    return{
      msg: '欢迎来到仓库管理系统',
    }
  },
  props: {
    icon: {
      type: String
    }
  }
}
</script>